//////////////////////////////////////////////////////////
// This class has been automatically generated on
// Tue Feb 24 17:04:14 2015 by ROOT version 5.34/09
// from TTree tree/tree
// found on file: ND280HL2AnaOutput_tag_24_02_AlNuWro_V2__14528_435546_krec1.root
//////////////////////////////////////////////////////////

#ifndef MECPlotting_h
#define MECPlotting_h

#include <TROOT.h>
#include <TChain.h>
#include <TFile.h>

// Header file for the classes stored in the TTree if any.
#include <TLorentzVector.h>
#include <TVector3.h>

// Fixed size dimensions of array or collections stored in the TTree if any.

class MECPlotting {
public :
   TTree          *fChain;   //!pointer to the analyzed TTree or TChain
   Int_t           fCurrent; //!current Tree number in a TChain
   
   
   int NEvents;
   TString outSaveName;
   TString filename;

   // Declaration of leaf types
 //TLorentzVector  *fMuonRec;
 TLorentzVector  *fMuonRec;
   TVector3        fMuonRecfP;
   Double_t        fMuonRecfPfX;
   Double_t        fMuonRecfPfY;
   Double_t        fMuonRecfPfZ;
   Double_t        fMuonRecfE;
 TVector3        *fMuonRecPt;
 //TVector3        fMuonRecPt;
   Double_t        fMuonRecPtfX;
   Double_t        fMuonRecPtfY;
   Double_t        fMuonRecPtfZ;
   Double_t        fMuonRecPtMag;
   Double_t        fMuonRecAlpha;
   Double_t        fMuonRecQ2;
 TVector3        *fMuonRecVertex;
   Double_t        fMuonRecVertexfX;
   Double_t        fMuonRecVertexfY;
   Double_t        fMuonRecVertexfZ;
 TVector3        *fMuonRecEndPos;
   Double_t        fMuonRecEndPosfX;
   Double_t        fMuonRecEndPosfY;
   Double_t        fMuonRecEndPosfZ;
 TVector3        *fMuonRecFlightPath;
   Double_t        fMuonRecFlightPathfX;
   Double_t        fMuonRecFlightPathfY;
   Double_t        fMuonRecFlightPathfZ;
   Double_t        fMuonRecChi2;
   Int_t           fMuonRecNDOF;
   Int_t           fMuonRecNdets[2];
   Int_t           fMuonRecNhits[3];
   Int_t           fMuonRecCharge[3];
   Int_t           fMuonRecID;
   Int_t           fMuonRecPDG;
   Int_t           fMuonRecType;
 TLorentzVector  *fMuonSim;
   TVector3        fMuonSimfP;
   Double_t        fMuonSimfPfX;
   Double_t        fMuonSimfPfY;
   Double_t        fMuonSimfPfZ;
   Double_t        fMuonSimfE;
 TVector3        *fMuonSimPt;
   Double_t        fMuonSimPtfX;
   Double_t        fMuonSimPtfY;
   Double_t        fMuonSimPtfZ;
   Double_t        fMuonSimPtMag;
   Double_t        fMuonSimAlpha;
   Double_t        fMuonSimQ2;
 TVector3        *fMuonSimVertex;
   Double_t        fMuonSimVertexfX;
   Double_t        fMuonSimVertexfY;
   Double_t        fMuonSimVertexfZ;
 TVector3        *fMuonSimEndPos;
   Double_t        fMuonSimEndPosfX;
   Double_t        fMuonSimEndPosfY;
   Double_t        fMuonSimEndPosfZ;
 TVector3        *fMuonSimFlightPath;
   Double_t        fMuonSimFlightPathfX;
   Double_t        fMuonSimFlightPathfY;
   Double_t        fMuonSimFlightPathfZ;
   Double_t        fMuonSimChi2;
   Int_t           fMuonSimNDOF;
   Int_t           fMuonSimNdets[2];
   Int_t           fMuonSimNhits[3];
   Int_t           fMuonSimCharge[3];
   Int_t           fMuonSimID;
   Int_t           fMuonSimPDG;
   Int_t           fMuonSimType;
 TLorentzVector  *fProtonRec;
   TVector3        fProtonRecfP;
   Double_t        fProtonRecfPfX;
   Double_t        fProtonRecfPfY;
   Double_t        fProtonRecfPfZ;
   Double_t        fProtonRecfE;
 TVector3        *fProtonRecPt;
   Double_t        fProtonRecPtfX;
   Double_t        fProtonRecPtfY;
   Double_t        fProtonRecPtfZ;
   Double_t        fProtonRecPtMag;
   Double_t        fProtonRecAlpha;
   Double_t        fProtonRecQ2;
 TVector3        *fProtonRecVertex;
   Double_t        fProtonRecVertexfX;
   Double_t        fProtonRecVertexfY;
   Double_t        fProtonRecVertexfZ;
 TVector3        *fProtonRecEndPos;
   Double_t        fProtonRecEndPosfX;
   Double_t        fProtonRecEndPosfY;
   Double_t        fProtonRecEndPosfZ;
 TVector3        *fProtonRecFlightPath;
   Double_t        fProtonRecFlightPathfX;
   Double_t        fProtonRecFlightPathfY;
   Double_t        fProtonRecFlightPathfZ;
   Double_t        fProtonRecChi2;
   Int_t           fProtonRecNDOF;
   Int_t           fProtonRecNdets[2];
   Int_t           fProtonRecNhits[3];
   Int_t           fProtonRecCharge[3];
   Int_t           fProtonRecID;
   Int_t           fProtonRecPDG;
   Int_t           fProtonRecType;
 TLorentzVector  *fProtonSim;
   TVector3        fProtonSimfP;
   Double_t        fProtonSimfPfX;
   Double_t        fProtonSimfPfY;
   Double_t        fProtonSimfPfZ;
   Double_t        fProtonSimfE;
 TVector3        *fProtonSimPt;
   Double_t        fProtonSimPtfX;
   Double_t        fProtonSimPtfY;
   Double_t        fProtonSimPtfZ;
   Double_t        fProtonSimPtMag;
   Double_t        fProtonSimAlpha;
   Double_t        fProtonSimQ2;
 TVector3        *fProtonSimVertex;
   Double_t        fProtonSimVertexfX;
   Double_t        fProtonSimVertexfY;
   Double_t        fProtonSimVertexfZ;
 TVector3        *fProtonSimEndPos;
   Double_t        fProtonSimEndPosfX;
   Double_t        fProtonSimEndPosfY;
   Double_t        fProtonSimEndPosfZ;
 TVector3        *fProtonSimFlightPath;
   Double_t        fProtonSimFlightPathfX;
   Double_t        fProtonSimFlightPathfY;
   Double_t        fProtonSimFlightPathfZ;
   Double_t        fProtonSimChi2;
   Int_t           fProtonSimNDOF;
   Int_t           fProtonSimNdets[2];
   Int_t           fProtonSimNhits[3];
   Int_t           fProtonSimCharge[3];
   Int_t           fProtonSimID;
   Int_t           fProtonSimPDG;
   Int_t           fProtonSimType;
 TVector3        *fDeltaRecPt;
   Double_t        fDeltaRecPtfX;
   Double_t        fDeltaRecPtfY;
   Double_t        fDeltaRecPtfZ;
 TVector3        *fDeltaSimPt;
   Double_t        fDeltaSimPtfX;
   Double_t        fDeltaSimPtfY;
   Double_t        fDeltaSimPtfZ;
   Double_t        fDeltaRecPhi_t;
   Double_t        fDeltaSimPhi_t;
 TVector3        *fRecKmu_t;
   Double_t        fRecKmu_tfX;
   Double_t        fRecKmu_tfY;
   Double_t        fRecKmu_tfZ;
 TVector3        *fSimKmu_t;
   Double_t        fSimKmu_tfX;
   Double_t        fSimKmu_tfY;
   Double_t        fSimKmu_tfZ;
 TVector3        *fRecKp_t;
   Double_t        fRecKp_tfX;
   Double_t        fRecKp_tfY;
   Double_t        fRecKp_tfZ;
 TVector3        *fSimKp_t;
   Double_t        fSimKp_tfX;
   Double_t        fSimKp_tfY;
   Double_t        fSimKp_tfZ;
   Double_t        fReconRecNuEnergy;
   Double_t        fReconSimNuEnergy;
   Double_t        fReconRecTgtMass;
   Double_t        fReconSimTgtMass;
 TLorentzVector  *fNeutronToy;
   TVector3        fNeutronToyfP;
   Double_t        fNeutronToyfPfX;
   Double_t        fNeutronToyfPfY;
   Double_t        fNeutronToyfPfZ;
   Double_t        fNeutronToyfE;
 TVector3        *fNeutronToyPt;
   Double_t        fNeutronToyPtfX;
   Double_t        fNeutronToyPtfY;
   Double_t        fNeutronToyPtfZ;
   Double_t        fNeutronToyPtMag;
   Double_t        fNeutronToyAlpha;
   Double_t        fNeutronToyQ2;
 TVector3        *fNeutronToyVertex;
   Double_t        fNeutronToyVertexfX;
   Double_t        fNeutronToyVertexfY;
   Double_t        fNeutronToyVertexfZ;
 TVector3        *fNeutronToyEndPos;
   Double_t        fNeutronToyEndPosfX;
   Double_t        fNeutronToyEndPosfY;
   Double_t        fNeutronToyEndPosfZ;
 TVector3        *fNeutronToyFlightPath;
   Double_t        fNeutronToyFlightPathfX;
   Double_t        fNeutronToyFlightPathfY;
   Double_t        fNeutronToyFlightPathfZ;
   Double_t        fNeutronToyChi2;
   Int_t           fNeutronToyNDOF;
   Int_t           fNeutronToyNdets[2];
   Int_t           fNeutronToyNhits[3];
   Int_t           fNeutronToyCharge[3];
   Int_t           fNeutronToyID;
   Int_t           fNeutronToyPDG;
   Int_t           fNeutronToyType;
 TLorentzVector  *fProtonToy;
   TVector3        fProtonToyfP;
   Double_t        fProtonToyfPfX;
   Double_t        fProtonToyfPfY;
   Double_t        fProtonToyfPfZ;
   Double_t        fProtonToyfE;
 TVector3        *fProtonToyPt;
   Double_t        fProtonToyPtfX;
   Double_t        fProtonToyPtfY;
   Double_t        fProtonToyPtfZ;
   Double_t        fProtonToyPtMag;
   Double_t        fProtonToyAlpha;
   Double_t        fProtonToyQ2;
 TVector3        *fProtonToyVertex;
   Double_t        fProtonToyVertexfX;
   Double_t        fProtonToyVertexfY;
   Double_t        fProtonToyVertexfZ;
 TVector3        *fProtonToyEndPos;
   Double_t        fProtonToyEndPosfX;
   Double_t        fProtonToyEndPosfY;
   Double_t        fProtonToyEndPosfZ;
 TVector3        *fProtonToyFlightPath;
   Double_t        fProtonToyFlightPathfX;
   Double_t        fProtonToyFlightPathfY;
   Double_t        fProtonToyFlightPathfZ;
   Double_t        fProtonToyChi2;
   Int_t           fProtonToyNDOF;
   Int_t           fProtonToyNdets[2];
   Int_t           fProtonToyNhits[3];
   Int_t           fProtonToyCharge[3];
   Int_t           fProtonToyID;
   Int_t           fProtonToyPDG;
   Int_t           fProtonToyType;
 TVector3        *fDeltaToyPt;
   Double_t        fDeltaoToyPtfX;
   Double_t        fDeltaToyPtfY;
   Double_t        fDeltaToyPtfZ;
 TLorentzVector  *fProtonDet;
   TVector3        fProtonDetfP;
   Double_t        fProtonDetfPfX;
   Double_t        fProtonDetfPfY;
   Double_t        fProtonDetfPfZ;
   Double_t        fProtonDetfE;
 TVector3        *fProtonDetPt;
   Double_t        fProtonDetPtfX;
   Double_t        fProtonDetPtfY;
   Double_t        fProtonDetPtfZ;
   Double_t        fProtonDetPtMag;
   Double_t        fProtonDetAlpha;
   Double_t        fProtonDetQ2;
 TVector3        *fProtonDetVertex;
   Double_t        fProtonDetVertexfX;
   Double_t        fProtonDetVertexfY;
   Double_t        fProtonDetVertexfZ;
 TVector3        *fProtonDetEndPos;
   Double_t        fProtonDetEndPosfX;
   Double_t        fProtonDetEndPosfY;
   Double_t        fProtonDetEndPosfZ;
 TVector3        *fProtonDetFlightPath;
   Double_t        fProtonDetFlightPathfX;
   Double_t        fProtonDetFlightPathfY;
   Double_t        fProtonDetFlightPathfZ;
   Double_t        fProtonDetChi2;
   Int_t           fProtonDetNDOF;
   Int_t           fProtonDetNdets[2];
   Int_t           fProtonDetNhits[3];
   Int_t           fProtonDetCharge[3];
   Int_t           fProtonDetID;
   Int_t           fProtonDetPDG;
   Int_t           fProtonDetType;
 TVector3        *fDeltaDetPt;
   Double_t        fDeltaDetPtfX;
   Double_t        fDeltaDetPtfY;
   Double_t        fDeltaDetPtfZ;
 TLorentzVector  *fNeutrinoSim;
   TVector3        fNeutrinoSimfP;
   Double_t        fNeutrinoSimfPfX;
   Double_t        fNeutrinoSimfPfY;
   Double_t        fNeutrinoSimfPfZ;
   Double_t        fNeutrinoSimfE;
 //TVector3        *fNeutrinoRec;
 TVector3        fNeutrinoRec;
   Double_t        fNeutrinoRecfX;
   Double_t        fNeutrinoRecfY;
   Double_t        fNeutrinoRecfZ;
 TVector3        *fNeutrinoGuess;
   Double_t        fNeutrinoGuessfX;
   Double_t        fNeutrinoGuessfY;
   Double_t        fNeutrinoGuessfZ;
   Double_t        fdNeutrinoGuessNeutrinoSim;
   Double_t        fdNeutrinoGuessMuonRec;
   Double_t        fGuessCorrection;
   Double_t        fMuonPtGuess;
   Double_t        fOsciMuMuProb;
   Int_t           fkOsciMuSurvive;
   Int_t           fNeutrinoParentPDG;
   Int_t           fNeutrinoParentType;
   Int_t           fNeutrinoType;
   Int_t           fNeutMode;
 TVector3        *fNeutrinoParentDecPointSim;
   Double_t        fNeutrinoParentDecPointSimfX;
   Double_t        fNeutrinoParentDecPointSimfY;
   Double_t        fNeutrinoParentDecPointSimfZ;
   Int_t           fMultiplicity;
   Int_t           fMuonNSim;
   Int_t           fMuonNRec;
   Int_t           fProtonNSim;
   Int_t           fProtonNRec;
   Double_t        fMeanBetaRec;
   Double_t        fMeanGammaRec;

   // List of branches
   //TBranch        *b_fMuonRec;   
   TBranch        *b_fMuonRec_fP;   
   TBranch        *b_fMuonRec_fE;   
   TBranch        *b_fMuonRecPt;   
   TBranch        *b_fMuonRecPt_fX;   
   TBranch        *b_fMuonRecPt_fY;   
   TBranch        *b_fMuonRecPt_fZ;   
   TBranch        *b_fMuonRecPtMag;   
   TBranch        *b_fMuonRecAlpha;   
   TBranch        *b_fMuonRecQ2;   
   TBranch        *b_fMuonRecVertex;   
   TBranch        *b_fMuonRecVertex_fX;   
   TBranch        *b_fMuonRecVertex_fY;   
   TBranch        *b_fMuonRecVertex_fZ;   
   TBranch        *b_fMuonRecEndPos;   
   TBranch        *b_fMuonRecEndPos_fX;   
   TBranch        *b_fMuonRecEndPos_fY;   
   TBranch        *b_fMuonRecEndPos_fZ;   
   TBranch        *b_fMuonRecFlightPath;   
   TBranch        *b_fMuonRecFlightPath_fX;   
   TBranch        *b_fMuonRecFlightPath_fY;   
   TBranch        *b_fMuonRecFlightPath_fZ;   
   TBranch        *b_fMuonRecChi2;   
   TBranch        *b_fMuonRecNDOF;   
   TBranch        *b_fMuonRecNdets;   
   TBranch        *b_fMuonRecNhits;   
   TBranch        *b_fMuonRecCharge;   
   TBranch        *b_fMuonRecID;   
   TBranch        *b_fMuonRecPDG;   
   TBranch        *b_fMuonRecType;   
   TBranch        *b_fMuonSim;   
   TBranch        *b_fMuonSim_fP;   
   TBranch        *b_fMuonSim_fE;   
   TBranch        *b_fMuonSimPt;   
   TBranch        *b_fMuonSimPt_fX;   
   TBranch        *b_fMuonSimPt_fY;   
   TBranch        *b_fMuonSimPt_fZ;   
   TBranch        *b_fMuonSimPtMag;   
   TBranch        *b_fMuonSimAlpha;   
   TBranch        *b_fMuonSimQ2;   
   TBranch        *b_fMuonSimVertex;   
   TBranch        *b_fMuonSimVertex_fX;   
   TBranch        *b_fMuonSimVertex_fY;   
   TBranch        *b_fMuonSimVertex_fZ;   
   TBranch        *b_fMuonSimEndPos;   
   TBranch        *b_fMuonSimEndPos_fX;   
   TBranch        *b_fMuonSimEndPos_fY;   
   TBranch        *b_fMuonSimEndPos_fZ;   
   TBranch        *b_fMuonSimFlightPath;   
   TBranch        *b_fMuonSimFlightPath_fX;   
   TBranch        *b_fMuonSimFlightPath_fY;   
   TBranch        *b_fMuonSimFlightPath_fZ;   
   TBranch        *b_fMuonSimChi2;   
   TBranch        *b_fMuonSimNDOF;   
   TBranch        *b_fMuonSimNdets;   
   TBranch        *b_fMuonSimNhits;   
   TBranch        *b_fMuonSimCharge;   
   TBranch        *b_fMuonSimID;   
   TBranch        *b_fMuonSimPDG;   
   TBranch        *b_fMuonSimType;   
   //TBranch        *b_fProtonRec;   
   TBranch        *b_fProtonRec_fP;   
   TBranch        *b_fProtonRec_fE;   
   TBranch        *b_fProtonRecPt_fX;   
   TBranch        *b_fProtonRecPt_fY;   
   TBranch        *b_fProtonRecPt_fZ;   
   TBranch        *b_fProtonRecPtMag;   
   TBranch        *b_fProtonRecAlpha;   
   TBranch        *b_fProtonRecQ2;   
   TBranch        *b_fProtonRecVertex;   
   TBranch        *b_fProtonRecVertex_fX;   
   TBranch        *b_fProtonRecVertex_fY;   
   TBranch        *b_fProtonRecVertex_fZ;   
   TBranch        *b_fProtonRecEndPos;   
   TBranch        *b_fProtonRecEndPos_fX;   
   TBranch        *b_fProtonRecEndPos_fY;   
   TBranch        *b_fProtonRecEndPos_fZ;   
   TBranch        *b_fProtonRecFlightPath;   
   TBranch        *b_fProtonRecFlightPath_fX;   
   TBranch        *b_fProtonRecFlightPath_fY;   
   TBranch        *b_fProtonRecFlightPath_fZ;   
   TBranch        *b_fProtonRecChi2;   
   TBranch        *b_fProtonRecNDOF;   
   TBranch        *b_fProtonRecNdets;   
   TBranch        *b_fProtonRecNhits;   
   TBranch        *b_fProtonRecCharge;   
   TBranch        *b_fProtonRecID;   
   TBranch        *b_fProtonRecPDG;   
   TBranch        *b_fProtonRecType;   
   TBranch        *b_fProtonSim;   
   TBranch        *b_fProtonSim_fP;   
   TBranch        *b_fProtonSim_fE;   
   TBranch        *b_fProtonSimPt;   
   TBranch        *b_fProtonSimPt_fX;   
   TBranch        *b_fProtonSimPt_fY;   
   TBranch        *b_fProtonSimPt_fZ;   
   TBranch        *b_fProtonSimPtMag;   
   TBranch        *b_fProtonSimAlpha;   
   TBranch        *b_fProtonSimQ2;   
   TBranch        *b_fProtonSimVertex;   
   TBranch        *b_fProtonSimVertex_fX;   
   TBranch        *b_fProtonSimVertex_fY;   
   TBranch        *b_fProtonSimVertex_fZ;   
   TBranch        *b_fProtonSimEndPos;   
   TBranch        *b_fProtonSimEndPos_fX;   
   TBranch        *b_fProtonSimEndPos_fY;   
   TBranch        *b_fProtonSimEndPos_fZ;   
   TBranch        *b_fProtonSimFlightPath;   
   TBranch        *b_fProtonSimFlightPath_fX;   
   TBranch        *b_fProtonSimFlightPath_fY;   
   TBranch        *b_fProtonSimFlightPath_fZ;   
   TBranch        *b_fProtonSimChi2;   
   TBranch        *b_fProtonSimNDOF;   
   TBranch        *b_fProtonSimNdets;   
   TBranch        *b_fProtonSimNhits;   
   TBranch        *b_fProtonSimCharge;   
   TBranch        *b_fProtonSimID;   
   TBranch        *b_fProtonSimPDG;   
   TBranch        *b_fProtonSimType;   
   TBranch        *b_fDeltaRecPt;   
   TBranch        *b_fDeltaRecPt_fX;   
   TBranch        *b_fDeltaRecPt_fY;   
   TBranch        *b_fDeltaRecPt_fZ;   
   TBranch        *b_fDeltaSimPt;   
   TBranch        *b_fDeltaSimPt_fX;   
   TBranch        *b_fDeltaSimPt_fY;   
   TBranch        *b_fDeltaSimPt_fZ;   
   TBranch        *b_fDeltaRecPhi_t;   
   TBranch        *b_fDeltaSimPhi_t;   
   TBranch        *b_fRecKmu_t;   
   TBranch        *b_fRecKmu_t_fX;   
   TBranch        *b_fRecKmu_t_fY;   
   TBranch        *b_fRecKmu_t_fZ;   
   TBranch        *b_fSimKmu_t;   
   TBranch        *b_fSimKmu_t_fX;   
   TBranch        *b_fSimKmu_t_fY;   
   TBranch        *b_fSimKmu_t_fZ;   
   TBranch        *b_fRecKp_t;   
   TBranch        *b_fRecKp_t_fX;   
   TBranch        *b_fRecKp_t_fY;   
   TBranch        *b_fRecKp_t_fZ;   
   TBranch        *b_fSimKp_t;   
   TBranch        *b_fSimKp_t_fX;   
   TBranch        *b_fSimKp_t_fY;   
   TBranch        *b_fSimKp_t_fZ;   
   TBranch        *b_fReconRecNuEnergy;   
   TBranch        *b_fReconSimNuEnergy;   
   TBranch        *b_fReconRecTgtMass;   
   TBranch        *b_fReconSimTgtMass;   
   TBranch        *b_fNeutronToy;   
   TBranch        *b_fNeutronToy_fP;   
   TBranch        *b_fNeutronToy_fE;   
   TBranch        *b_fNeutronToyPt;   
   TBranch        *b_fNeutronToyPt_fX;   
   TBranch        *b_fNeutronToyPt_fY;   
   TBranch        *b_fNeutronToyPt_fZ;   
   TBranch        *b_fNeutronToyPtMag;   
   TBranch        *b_fNeutronToyAlpha;   
   TBranch        *b_fNeutronToyQ2;   
   TBranch        *b_fNeutronToyVertex;   
   TBranch        *b_fNeutronToyVertex_fX;   
   TBranch        *b_fNeutronToyVertex_fY;   
   TBranch        *b_fNeutronToyVertex_fZ;   
   TBranch        *b_fNeutronToyEndPos;   
   TBranch        *b_fNeutronToyEndPos_fX;   
   TBranch        *b_fNeutronToyEndPos_fY;   
   TBranch        *b_fNeutronToyEndPos_fZ;   
   TBranch        *b_fNeutronToyFlightPath;   
   TBranch        *b_fNeutronToyFlightPath_fX;   
   TBranch        *b_fNeutronToyFlightPath_fY;   
   TBranch        *b_fNeutronToyFlightPath_fZ;   
   TBranch        *b_fNeutronToyChi2;   
   TBranch        *b_fNeutronToyNDOF;   
   TBranch        *b_fNeutronToyNdets;   
   TBranch        *b_fNeutronToyNhits;   
   TBranch        *b_fNeutronToyCharge;   
   TBranch        *b_fNeutronToyID;   
   TBranch        *b_fNeutronToyPDG;   
   TBranch        *b_fNeutronToyType;   
   TBranch        *b_fProtonToy;   
   TBranch        *b_fProtonToy_fP;   
   TBranch        *b_fProtonToy_fE;   
   TBranch        *b_fProtonToyPt;   
   TBranch        *b_fProtonToyPt_fX;   
   TBranch        *b_fProtonToyPt_fY;   
   TBranch        *b_fProtonToyPt_fZ;   
   TBranch        *b_fProtonToyPtMag;   
   TBranch        *b_fProtonToyAlpha;   
   TBranch        *b_fProtonToyQ2;   
   TBranch        *b_fProtonToyVertex;   
   TBranch        *b_fProtonToyVertex_fX;   
   TBranch        *b_fProtonToyVertex_fY;   
   TBranch        *b_fProtonToyVertex_fZ;   
   TBranch        *b_fProtonToyEndPos;   
   TBranch        *b_fProtonToyEndPos_fX;   
   TBranch        *b_fProtonToyEndPos_fY;   
   TBranch        *b_fProtonToyEndPos_fZ;   
   TBranch        *b_fProtonToyFlightPath;   
   TBranch        *b_fProtonToyFlightPath_fX;   
   TBranch        *b_fProtonToyFlightPath_fY;   
   TBranch        *b_fProtonToyFlightPath_fZ;   
   TBranch        *b_fProtonToyChi2;   
   TBranch        *b_fProtonToyNDOF;   
   TBranch        *b_fProtonToyNdets;   
   TBranch        *b_fProtonToyNhits;   
   TBranch        *b_fProtonToyCharge;   
   TBranch        *b_fProtonToyID;   
   TBranch        *b_fProtonToyPDG;   
   TBranch        *b_fProtonToyType;   
   TBranch        *b_fDeltaToyPt;   
   TBranch        *b_fDeltaToyPt_fX;   
   TBranch        *b_fDeltaToyPt_fY;   
   TBranch        *b_fDeltaToyPt_fZ;   
   TBranch        *b_fProtonDet;   
   TBranch        *b_fProtonDet_fP;   
   TBranch        *b_fProtonDet_fE;   
   TBranch        *b_fProtonDetPt;   
   TBranch        *b_fProtonDetPt_fX;   
   TBranch        *b_fProtonDetPt_fY;   
   TBranch        *b_fProtonDetPt_fZ;   
   TBranch        *b_fProtonDetPtMag;   
   TBranch        *b_fProtonDetAlpha;   
   TBranch        *b_fProtonDetQ2;   
   TBranch        *b_fProtonDetVertex;   
   TBranch        *b_fProtonDetVertex_fX;   
   TBranch        *b_fProtonDetVertex_fY;   
   TBranch        *b_fProtonDetVertex_fZ;   
   TBranch        *b_fProtonDetEndPos;   
   TBranch        *b_fProtonDetEndPos_fX;   
   TBranch        *b_fProtonDetEndPos_fY;   
   TBranch        *b_fProtonDetEndPos_fZ;   
   TBranch        *b_fProtonDetFlightPath;   
   TBranch        *b_fProtonDetFlightPath_fX;   
   TBranch        *b_fProtonDetFlightPath_fY;   
   TBranch        *b_fProtonDetFlightPath_fZ;   
   TBranch        *b_fProtonDetChi2;   
   TBranch        *b_fProtonDetNDOF;   
   TBranch        *b_fProtonDetNdets;   
   TBranch        *b_fProtonDetNhits;   
   TBranch        *b_fProtonDetCharge;   
   TBranch        *b_fProtonDetID;   
   TBranch        *b_fProtonDetPDG;   
   TBranch        *b_fProtonDetType;   
   TBranch        *b_fDeltaDetPt;   
   TBranch        *b_fDeltaDetPt_fX;   
   TBranch        *b_fDeltaDetPt_fY;   
   TBranch        *b_fDeltaDetPt_fZ;   
   TBranch        *b_fNeutrinoSim;   
   TBranch        *b_fNeutrinoSim_fP;   
   TBranch        *b_fNeutrinoSim_fE;   
   TBranch        *b_fNeutrinoRec;   
   TBranch        *b_fNeutrinoRec_fX;   
   TBranch        *b_fNeutrinoRec_fY;   
   TBranch        *b_fNeutrinoRec_fZ;   
   TBranch        *b_fNeutrinoGuess;   
   TBranch        *b_fNeutrinoGuess_fX;   
   TBranch        *b_fNeutrinoGuess_fY;   
   TBranch        *b_fNeutrinoGuess_fZ;   
   TBranch        *b_fdNeutrinoGuessNeutrinoSim;   
   TBranch        *b_fdNeutrinoGuessMuonRec;   
   TBranch        *b_fGuessCorrection;   
   TBranch        *b_fMuonPtGuess;   
   TBranch        *b_fOsciMuMuProb;   
   TBranch        *b_fkOsciMuSurvive;   
   TBranch        *b_fNeutrinoParentPDG;   
   TBranch        *b_fNeutrinoParentType;   
   TBranch        *b_fNeutrinoType;   
   TBranch        *b_fNeutMode;   
   TBranch        *b_fNeutrinoParentDecPointSim;   
   TBranch        *b_fNeutrinoParentDecPointSim_fX;   
   TBranch        *b_fNeutrinoParentDecPointSim_fY;   
   TBranch        *b_fNeutrinoParentDecPointSim_fZ;   
   TBranch        *b_fMultiplicity;   
   TBranch        *b_fMuonNSim;   
   TBranch        *b_fMuonNRec;   
   TBranch        *b_fProtonNSim;   
   TBranch        *b_fProtonNRec;   
   TBranch        *b_fMeanBetaRec;   
   TBranch        *b_fMeanGammaRec;   

   MECPlotting(TTree *tree=0);
   virtual ~MECPlotting();
   virtual Int_t    Cut(Long64_t entry);
   virtual Int_t    GetEntry(Long64_t entry);
   virtual Long64_t LoadTree(Long64_t entry);
   //virtual void     Init(TTree *tree);
   virtual void     Init(TTree *tree);
   //virtual void     Loop();
   virtual int      fillHists(int, TList*&);
   virtual int      analysis(int, TString, TString); 
   virtual Bool_t   Notify();
   virtual void     Show(Long64_t entry = -1);
   virtual Int_t    SelectFile(TString filename);
};

#endif

#ifdef MECPlotting_cxx
MECPlotting::MECPlotting(TTree *tree) : fChain(0) 
{
// if parameter tree is not specified (or zero), connect the file
// used to generate this class and read the Tree.
/*
   if (tree == 0) {
      TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("ND280HL2AnaOutput_tag_24_02_AlNuWro_V2__14528_435546_krec1.root");
      if (!f || !f->IsOpen()) {
         f = new TFile("ND280HL2AnaOutput_tag_24_02_AlNuWro_V2__14528_435546_krec1.root");
      }
      f->GetObject("tree",tree);

   }
   Init(tree);
*/
}


MECPlotting::~MECPlotting()
{
   if (!fChain) return;
   delete fChain->GetCurrentFile();
}



Int_t MECPlotting::GetEntry(Long64_t entry)
{
// Read contents of entry.
   if (!fChain) return 0;
   return fChain->GetEntry(entry);
}
Int_t MECPlotting::SelectFile(TString filename) 
{
  TTree* tree;
  TFile* f = new TFile(filename);
  f->GetObject("tree",tree);
  Init(tree);
  if(tree->GetEntry(1)<1.) return 1;
  else return 0;
}
Long64_t MECPlotting::LoadTree(Long64_t entry)
{
// Set the environment to read one entry
   if (!fChain) return -5;
   Long64_t centry = fChain->LoadTree(entry);
   if (centry < 0) return centry;
   if (fChain->GetTreeNumber() != fCurrent) {
      fCurrent = fChain->GetTreeNumber();
      Notify();
   }
   return centry;
}

void MECPlotting::Init(TTree *tree)
{
   // The Init() function is called when the selector needs to initialize
   // a new tree or chain. Typically here the branch addresses and branch
   // pointers of the tree will be set.
   // It is normally not necessary to make changes to the generated
   // code, but the routine can be extended by the user if needed.
   // Init() will be called many times when running on PROOF
   // (once per file to be processed).

   // Set branch addresses and branch pointers
   if (!tree) return;
   fChain = tree;
   fCurrent = -1;
   fChain->SetMakeClass(1);

   
   //fChain->SetBranchAddress("fProtonRec", &fProtonRec);

   //fChain->SetBranchAddress("fMuonRec", &fMuonRec);
   fChain->SetBranchAddress("fMuonRec.fP.fX", &fMuonRecfPfX);//, &b_fMuonRec_fP);
   fChain->SetBranchAddress("fMuonRec.fP.fY", &fMuonRecfPfY);//, &b_fMuonRec_fP);
   fChain->SetBranchAddress("fMuonRec.fP.fZ", &fMuonRecfPfZ);//, &b_fMuonRec_fP);
   fChain->SetBranchAddress("fMuonRec.fE", &fMuonRecfE);//, &b_fMuonRec_fE);
   fChain->SetBranchAddress("fMuonRecPt.fX", &fMuonRecPtfX, &b_fMuonRecPt_fX);
   fChain->SetBranchAddress("fMuonRecPt.fY", &fMuonRecPtfY, &b_fMuonRecPt_fY);
   fChain->SetBranchAddress("fMuonRecPt.fZ", &fMuonRecPtfZ, &b_fMuonRecPt_fZ);
   fChain->SetBranchAddress("fMuonRecPtMag", &fMuonRecPtMag, &b_fMuonRecPtMag);
   fChain->SetBranchAddress("fMuonRecAlpha", &fMuonRecAlpha, &b_fMuonRecAlpha);
   fChain->SetBranchAddress("fMuonRecQ2", &fMuonRecQ2, &b_fMuonRecQ2);
   fChain->SetBranchAddress("fMuonRecVertex.fX", &fMuonRecVertexfX, &b_fMuonRecVertex_fX);
   fChain->SetBranchAddress("fMuonRecVertex.fY", &fMuonRecVertexfY, &b_fMuonRecVertex_fY);
   fChain->SetBranchAddress("fMuonRecVertex.fZ", &fMuonRecVertexfZ, &b_fMuonRecVertex_fZ);
   fChain->SetBranchAddress("fMuonRecEndPos.fX", &fMuonRecEndPosfX, &b_fMuonRecEndPos_fX);
   fChain->SetBranchAddress("fMuonRecEndPos.fY", &fMuonRecEndPosfY, &b_fMuonRecEndPos_fY);
   fChain->SetBranchAddress("fMuonRecEndPos.fZ", &fMuonRecEndPosfZ, &b_fMuonRecEndPos_fZ);
   fChain->SetBranchAddress("fMuonRecFlightPath.fX", &fMuonRecFlightPathfX, &b_fMuonRecFlightPath_fX);
   fChain->SetBranchAddress("fMuonRecFlightPath.fY", &fMuonRecFlightPathfY, &b_fMuonRecFlightPath_fY);
   fChain->SetBranchAddress("fMuonRecFlightPath.fZ", &fMuonRecFlightPathfZ, &b_fMuonRecFlightPath_fZ);
   fChain->SetBranchAddress("fMuonRecChi2", &fMuonRecChi2, &b_fMuonRecChi2);
   fChain->SetBranchAddress("fMuonRecNDOF", &fMuonRecNDOF, &b_fMuonRecNDOF);
   fChain->SetBranchAddress("fMuonRecNdets", fMuonRecNdets, &b_fMuonRecNdets);
   fChain->SetBranchAddress("fMuonRecNhits", fMuonRecNhits, &b_fMuonRecNhits);
   fChain->SetBranchAddress("fMuonRecCharge", fMuonRecCharge, &b_fMuonRecCharge);
   fChain->SetBranchAddress("fMuonRecID", &fMuonRecID, &b_fMuonRecID);
   fChain->SetBranchAddress("fMuonRecPDG", &fMuonRecPDG, &b_fMuonRecPDG);
   fChain->SetBranchAddress("fMuonRecType", &fMuonRecType, &b_fMuonRecType);
   fChain->SetBranchAddress("fMuonSim.fP.fX", &fMuonSimfPfX);//, &b_fMuonSim_fP);
   fChain->SetBranchAddress("fMuonSim.fP.fY", &fMuonSimfPfY);//, &b_fMuonSim_fP);
   fChain->SetBranchAddress("fMuonSim.fP.fZ", &fMuonSimfPfZ);//, &b_fMuonSim_fP);
   fChain->SetBranchAddress("fMuonSim.fE", &fMuonSimfE, &b_fMuonSim_fE);
   fChain->SetBranchAddress("fMuonSimPt.fX", &fMuonSimPtfX, &b_fMuonSimPt_fX);
   fChain->SetBranchAddress("fMuonSimPt.fY", &fMuonSimPtfY, &b_fMuonSimPt_fY);
   fChain->SetBranchAddress("fMuonSimPt.fZ", &fMuonSimPtfZ, &b_fMuonSimPt_fZ);
   fChain->SetBranchAddress("fMuonSimPtMag", &fMuonSimPtMag, &b_fMuonSimPtMag);
   fChain->SetBranchAddress("fMuonSimAlpha", &fMuonSimAlpha, &b_fMuonSimAlpha);
   fChain->SetBranchAddress("fMuonSimQ2", &fMuonSimQ2, &b_fMuonSimQ2);
   fChain->SetBranchAddress("fX", &fMuonSimVertexfX, &b_fMuonSimVertex_fX);
   fChain->SetBranchAddress("fY", &fMuonSimVertexfY, &b_fMuonSimVertex_fY);
   fChain->SetBranchAddress("fZ", &fMuonSimVertexfZ, &b_fMuonSimVertex_fZ);
   fChain->SetBranchAddress("fX", &fMuonSimEndPosfX, &b_fMuonSimEndPos_fX);
   fChain->SetBranchAddress("fY", &fMuonSimEndPosfY, &b_fMuonSimEndPos_fY);
   fChain->SetBranchAddress("fZ", &fMuonSimEndPosfZ, &b_fMuonSimEndPos_fZ);
   fChain->SetBranchAddress("fX", &fMuonSimFlightPathfX, &b_fMuonSimFlightPath_fX);
   fChain->SetBranchAddress("fY", &fMuonSimFlightPathfY, &b_fMuonSimFlightPath_fY);
   fChain->SetBranchAddress("fZ", &fMuonSimFlightPathfZ, &b_fMuonSimFlightPath_fZ);
   fChain->SetBranchAddress("fMuonSimChi2", &fMuonSimChi2, &b_fMuonSimChi2);
   fChain->SetBranchAddress("fMuonSimNDOF", &fMuonSimNDOF, &b_fMuonSimNDOF);
   fChain->SetBranchAddress("fMuonSimNdets", fMuonSimNdets, &b_fMuonSimNdets);
   fChain->SetBranchAddress("fMuonSimNhits", fMuonSimNhits, &b_fMuonSimNhits);
   fChain->SetBranchAddress("fMuonSimCharge", fMuonSimCharge, &b_fMuonSimCharge);
   fChain->SetBranchAddress("fMuonSimID", &fMuonSimID, &b_fMuonSimID);
   fChain->SetBranchAddress("fMuonSimPDG", &fMuonSimPDG, &b_fMuonSimPDG);
   fChain->SetBranchAddress("fMuonSimType", &fMuonSimType, &b_fMuonSimType);
   fChain->SetBranchAddress("fProtonRec.fP.fX", &fProtonRecfPfX);//, &b_fProtonRec_fP);
   fChain->SetBranchAddress("fProtonRec.fP.fY", &fProtonRecfPfY);//, &b_fProtonRec_fP);
   fChain->SetBranchAddress("fProtonRec.fP.fZ", &fProtonRecfPfZ);//, &b_fProtonRec_fP);
   fChain->SetBranchAddress("fProtonRec.fE", &fProtonRecfE, &b_fProtonRec_fE);
   fChain->SetBranchAddress("fProtonRecPt.fX", &fProtonRecPtfX, &b_fProtonRecPt_fX);
   fChain->SetBranchAddress("fProtonRecPt.fY", &fProtonRecPtfY, &b_fProtonRecPt_fY);
   fChain->SetBranchAddress("fProtonRecPt.fZ", &fProtonRecPtfZ, &b_fProtonRecPt_fZ);
   fChain->SetBranchAddress("fProtonRecPtMag", &fProtonRecPtMag, &b_fProtonRecPtMag);
   fChain->SetBranchAddress("fProtonRecAlpha", &fProtonRecAlpha, &b_fProtonRecAlpha);
   fChain->SetBranchAddress("fProtonRecQ2", &fProtonRecQ2, &b_fProtonRecQ2);
   fChain->SetBranchAddress("fX", &fProtonRecVertexfX, &b_fProtonRecVertex_fX);
   fChain->SetBranchAddress("fY", &fProtonRecVertexfY, &b_fProtonRecVertex_fY);
   fChain->SetBranchAddress("fZ", &fProtonRecVertexfZ, &b_fProtonRecVertex_fZ);
   fChain->SetBranchAddress("fX", &fProtonRecEndPosfX, &b_fProtonRecEndPos_fX);
   fChain->SetBranchAddress("fY", &fProtonRecEndPosfY, &b_fProtonRecEndPos_fY);
   fChain->SetBranchAddress("fZ", &fProtonRecEndPosfZ, &b_fProtonRecEndPos_fZ);
   fChain->SetBranchAddress("fX", &fProtonRecFlightPathfX, &b_fProtonRecFlightPath_fX);
   fChain->SetBranchAddress("fY", &fProtonRecFlightPathfY, &b_fProtonRecFlightPath_fY);
   fChain->SetBranchAddress("fZ", &fProtonRecFlightPathfZ, &b_fProtonRecFlightPath_fZ);
   fChain->SetBranchAddress("fProtonRecChi2", &fProtonRecChi2, &b_fProtonRecChi2);
   fChain->SetBranchAddress("fProtonRecNDOF", &fProtonRecNDOF, &b_fProtonRecNDOF);
   fChain->SetBranchAddress("fProtonRecNdets", fProtonRecNdets, &b_fProtonRecNdets);
   fChain->SetBranchAddress("fProtonRecNhits", fProtonRecNhits, &b_fProtonRecNhits);
   fChain->SetBranchAddress("fProtonRecCharge", fProtonRecCharge, &b_fProtonRecCharge);
   fChain->SetBranchAddress("fProtonRecID", &fProtonRecID, &b_fProtonRecID);
   fChain->SetBranchAddress("fProtonRecPDG", &fProtonRecPDG, &b_fProtonRecPDG);
   fChain->SetBranchAddress("fProtonRecType", &fProtonRecType, &b_fProtonRecType);
   fChain->SetBranchAddress("fProtonSim.fP.fX", &fProtonSimfPfX);//, &b_fProtonSim_fP);
   fChain->SetBranchAddress("fProtonSim.fP.fY", &fProtonSimfPfY);//, &b_fProtonSim_fP);
   fChain->SetBranchAddress("fProtonSim.fP.fZ", &fProtonSimfPfZ);//, &b_fProtonSim_fP);
   fChain->SetBranchAddress("fProtonSim.fE", &fProtonSimfE, &b_fProtonSim_fE);
   fChain->SetBranchAddress("fProtonSimPt.fX", &fProtonSimPtfX, &b_fProtonSimPt_fX);
   fChain->SetBranchAddress("fProtonSimPt.fY", &fProtonSimPtfY, &b_fProtonSimPt_fY);
   fChain->SetBranchAddress("fProtonSimPt.fZ", &fProtonSimPtfZ, &b_fProtonSimPt_fZ);
   fChain->SetBranchAddress("fProtonSimPtMag", &fProtonSimPtMag, &b_fProtonSimPtMag);
   fChain->SetBranchAddress("fProtonSimAlpha", &fProtonSimAlpha, &b_fProtonSimAlpha);
   fChain->SetBranchAddress("fProtonSimQ2", &fProtonSimQ2, &b_fProtonSimQ2);
   fChain->SetBranchAddress("fX", &fProtonSimVertexfX, &b_fProtonSimVertex_fX);
   fChain->SetBranchAddress("fY", &fProtonSimVertexfY, &b_fProtonSimVertex_fY);
   fChain->SetBranchAddress("fZ", &fProtonSimVertexfZ, &b_fProtonSimVertex_fZ);
   fChain->SetBranchAddress("fX", &fProtonSimEndPosfX, &b_fProtonSimEndPos_fX);
   fChain->SetBranchAddress("fY", &fProtonSimEndPosfY, &b_fProtonSimEndPos_fY);
   fChain->SetBranchAddress("fZ", &fProtonSimEndPosfZ, &b_fProtonSimEndPos_fZ);
   fChain->SetBranchAddress("fX", &fProtonSimFlightPathfX, &b_fProtonSimFlightPath_fX);
   fChain->SetBranchAddress("fY", &fProtonSimFlightPathfY, &b_fProtonSimFlightPath_fY);
   fChain->SetBranchAddress("fZ", &fProtonSimFlightPathfZ, &b_fProtonSimFlightPath_fZ);
   fChain->SetBranchAddress("fProtonSimChi2", &fProtonSimChi2, &b_fProtonSimChi2);
   fChain->SetBranchAddress("fProtonSimNDOF", &fProtonSimNDOF, &b_fProtonSimNDOF);
   fChain->SetBranchAddress("fProtonSimNdets", fProtonSimNdets, &b_fProtonSimNdets);
   fChain->SetBranchAddress("fProtonSimNhits", fProtonSimNhits, &b_fProtonSimNhits);
   fChain->SetBranchAddress("fProtonSimCharge", fProtonSimCharge, &b_fProtonSimCharge);
   fChain->SetBranchAddress("fProtonSimID", &fProtonSimID, &b_fProtonSimID);
   fChain->SetBranchAddress("fProtonSimPDG", &fProtonSimPDG, &b_fProtonSimPDG);
   fChain->SetBranchAddress("fProtonSimType", &fProtonSimType, &b_fProtonSimType);
   fChain->SetBranchAddress("fDeltaRecPt.fX", &fDeltaRecPtfX, &b_fDeltaRecPt_fX);
   fChain->SetBranchAddress("fDeltaRecPt.fY", &fDeltaRecPtfY, &b_fDeltaRecPt_fY);
   fChain->SetBranchAddress("fDeltaRecPt.fZ", &fDeltaRecPtfZ, &b_fDeltaRecPt_fZ);
   fChain->SetBranchAddress("fDeltaSimPt.fX", &fDeltaSimPtfX, &b_fDeltaSimPt_fX);
   fChain->SetBranchAddress("fDeltaSimPt.fY", &fDeltaSimPtfY, &b_fDeltaSimPt_fY);
   fChain->SetBranchAddress("fDeltaSimPt.fZ", &fDeltaSimPtfZ, &b_fDeltaSimPt_fZ);
   fChain->SetBranchAddress("fDeltaRecPhi_t", &fDeltaRecPhi_t, &b_fDeltaRecPhi_t);
   fChain->SetBranchAddress("fDeltaSimPhi_t", &fDeltaSimPhi_t, &b_fDeltaSimPhi_t);
   fChain->SetBranchAddress("fRecKmu_t.fX", &fRecKmu_tfX, &b_fRecKmu_t_fX);
   fChain->SetBranchAddress("fRecKmu_t.fY", &fRecKmu_tfY, &b_fRecKmu_t_fY);
   fChain->SetBranchAddress("fRecKmu_t.fZ", &fRecKmu_tfZ, &b_fRecKmu_t_fZ);
   fChain->SetBranchAddress("fSimKmu_t.fX", &fSimKmu_tfX, &b_fSimKmu_t_fX);
   fChain->SetBranchAddress("fSimKmu_t.fY", &fSimKmu_tfY, &b_fSimKmu_t_fY);
   fChain->SetBranchAddress("fSimKmu_t.fZ", &fSimKmu_tfZ, &b_fSimKmu_t_fZ);
   fChain->SetBranchAddress("fRecKp_t.fX", &fRecKp_tfX, &b_fRecKp_t_fX);
   fChain->SetBranchAddress("fRecKp_t.fY", &fRecKp_tfY, &b_fRecKp_t_fY);
   fChain->SetBranchAddress("fRecKp_t.fZ", &fRecKp_tfZ, &b_fRecKp_t_fZ);
   fChain->SetBranchAddress("fSimKp_t.fX", &fSimKp_tfX, &b_fSimKp_t_fX);
   fChain->SetBranchAddress("fSimKp_t.fY", &fSimKp_tfY, &b_fSimKp_t_fY);
   fChain->SetBranchAddress("fSimKp_t.fZ", &fSimKp_tfZ, &b_fSimKp_t_fZ);
   fChain->SetBranchAddress("fReconRecNuEnergy", &fReconRecNuEnergy, &b_fReconRecNuEnergy);
   fChain->SetBranchAddress("fReconSimNuEnergy", &fReconSimNuEnergy, &b_fReconSimNuEnergy);
   fChain->SetBranchAddress("fReconRecTgtMass", &fReconRecTgtMass, &b_fReconRecTgtMass);
   fChain->SetBranchAddress("fReconSimTgtMass", &fReconSimTgtMass, &b_fReconSimTgtMass);
/*   fChain->SetBranchAddress("fNeutronToy.fP", &fNeutronToyfP, &b_fNeutronToy_fP);
   fChain->SetBranchAddress("fNeutronToy.fE", &fNeutronToyfE, &b_fNeutronToy_fE);
   fChain->SetBranchAddress("fX", &fNeutronToyPtfX, &b_fNeutronToyPt_fX);
   fChain->SetBranchAddress("fY", &fNeutronToyPtfY, &b_fNeutronToyPt_fY);
   fChain->SetBranchAddress("fZ", &fNeutronToyPtfZ, &b_fNeutronToyPt_fZ);
   fChain->SetBranchAddress("fNeutronToyPtMag", &fNeutronToyPtMag, &b_fNeutronToyPtMag);
   fChain->SetBranchAddress("fNeutronToyAlpha", &fNeutronToyAlpha, &b_fNeutronToyAlpha);
   fChain->SetBranchAddress("fNeutronToyQ2", &fNeutronToyQ2, &b_fNeutronToyQ2);
//    fChain->SetBranchAddress("fX", &fX, &b_fNeutronToyVertex_fX);
//    fChain->SetBranchAddress("fY", &fY, &b_fNeutronToyVertex_fY);
//    fChain->SetBranchAddress("fZ", &fZ, &b_fNeutronToyVertex_fZ);
//    fChain->SetBranchAddress("fX", &fX, &b_fNeutronToyEndPos_fX);
//    fChain->SetBranchAddress("fY", &fY, &b_fNeutronToyEndPos_fY);
//    fChain->SetBranchAddress("fZ", &fZ, &b_fNeutronToyEndPos_fZ);
//    fChain->SetBranchAddress("fX", &fX, &b_fNeutronToyFlightPath_fX);
//    fChain->SetBranchAddress("fY", &fY, &b_fNeutronToyFlightPath_fY);
//    fChain->SetBranchAddress("fZ", &fZ, &b_fNeutronToyFlightPath_fZ);
   fChain->SetBranchAddress("fNeutronToyChi2", &fNeutronToyChi2, &b_fNeutronToyChi2);
   fChain->SetBranchAddress("fNeutronToyNDOF", &fNeutronToyNDOF, &b_fNeutronToyNDOF);
   fChain->SetBranchAddress("fNeutronToyNdets", fNeutronToyNdets, &b_fNeutronToyNdets);
   fChain->SetBranchAddress("fNeutronToyNhits", fNeutronToyNhits, &b_fNeutronToyNhits);
   fChain->SetBranchAddress("fNeutronToyCharge", fNeutronToyCharge, &b_fNeutronToyCharge);
   fChain->SetBranchAddress("fNeutronToyID", &fNeutronToyID, &b_fNeutronToyID);
   fChain->SetBranchAddress("fNeutronToyPDG", &fNeutronToyPDG, &b_fNeutronToyPDG);
   fChain->SetBranchAddress("fNeutronToyType", &fNeutronToyType, &b_fNeutronToyType);
//    fChain->SetBranchAddress("fP", &fP, &b_fProtonToy_fP);
//    fChain->SetBranchAddress("fE", &fE, &b_fProtonToy_fE);
//    fChain->SetBranchAddress("fX", &fX, &b_fProtonToyPt_fX);
//    fChain->SetBranchAddress("fY", &fY, &b_fProtonToyPt_fY);
//    fChain->SetBranchAddress("fZ", &fZ, &b_fProtonToyPt_fZ);
   fChain->SetBranchAddress("fProtonToyPtMag", &fProtonToyPtMag, &b_fProtonToyPtMag);
   fChain->SetBranchAddress("fProtonToyAlpha", &fProtonToyAlpha, &b_fProtonToyAlpha);
   fChain->SetBranchAddress("fProtonToyQ2", &fProtonToyQ2, &b_fProtonToyQ2);
//    fChain->SetBranchAddress("fX", &fX, &b_fProtonToyVertex_fX);
//    fChain->SetBranchAddress("fY", &fY, &b_fProtonToyVertex_fY);
//    fChain->SetBranchAddress("fZ", &fZ, &b_fProtonToyVertex_fZ);
//    fChain->SetBranchAddress("fX", &fX, &b_fProtonToyEndPos_fX);
//    fChain->SetBranchAddress("fY", &fY, &b_fProtonToyEndPos_fY);
//    fChain->SetBranchAddress("fZ", &fZ, &b_fProtonToyEndPos_fZ);
//    fChain->SetBranchAddress("fX", &fX, &b_fProtonToyFlightPath_fX);
//    fChain->SetBranchAddress("fY", &fY, &b_fProtonToyFlightPath_fY);
//    fChain->SetBranchAddress("fZ", &fZ, &b_fProtonToyFlightPath_fZ);
   fChain->SetBranchAddress("fProtonToyChi2", &fProtonToyChi2, &b_fProtonToyChi2);
   fChain->SetBranchAddress("fProtonToyNDOF", &fProtonToyNDOF, &b_fProtonToyNDOF);
   fChain->SetBranchAddress("fProtonToyNdets", fProtonToyNdets, &b_fProtonToyNdets);
   fChain->SetBranchAddress("fProtonToyNhits", fProtonToyNhits, &b_fProtonToyNhits);
   fChain->SetBranchAddress("fProtonToyCharge", fProtonToyCharge, &b_fProtonToyCharge);
   fChain->SetBranchAddress("fProtonToyID", &fProtonToyID, &b_fProtonToyID);
   fChain->SetBranchAddress("fProtonToyPDG", &fProtonToyPDG, &b_fProtonToyPDG);
   fChain->SetBranchAddress("fProtonToyType", &fProtonToyType, &b_fProtonToyType);
//    fChain->SetBranchAddress("fX", &fX, &b_fDeltaToyPt_fX);
//    fChain->SetBranchAddress("fY", &fY, &b_fDeltaToyPt_fY);
//    fChain->SetBranchAddress("fZ", &fZ, &b_fDeltaToyPt_fZ);
//    fChain->SetBranchAddress("fP", &fP, &b_fProtonDet_fP);
//    fChain->SetBranchAddress("fE", &fE, &b_fProtonDet_fE);
//    fChain->SetBranchAddress("fX", &fX, &b_fProtonDetPt_fX);
//    fChain->SetBranchAddress("fY", &fY, &b_fProtonDetPt_fY);
//    fChain->SetBranchAddress("fZ", &fZ, &b_fProtonDetPt_fZ);
   fChain->SetBranchAddress("fProtonDetPtMag", &fProtonDetPtMag, &b_fProtonDetPtMag);
   fChain->SetBranchAddress("fProtonDetAlpha", &fProtonDetAlpha, &b_fProtonDetAlpha);
   fChain->SetBranchAddress("fProtonDetQ2", &fProtonDetQ2, &b_fProtonDetQ2);
//    fChain->SetBranchAddress("fX", &fX, &b_fProtonDetVertex_fX);
//    fChain->SetBranchAddress("fY", &fY, &b_fProtonDetVertex_fY);
//    fChain->SetBranchAddress("fZ", &fZ, &b_fProtonDetVertex_fZ);
//    fChain->SetBranchAddress("fX", &fX, &b_fProtonDetEndPos_fX);
//    fChain->SetBranchAddress("fY", &fY, &b_fProtonDetEndPos_fY);
//    fChain->SetBranchAddress("fZ", &fZ, &b_fProtonDetEndPos_fZ);
//    fChain->SetBranchAddress("fX", &fX, &b_fProtonDetFlightPath_fX);
//    fChain->SetBranchAddress("fY", &fY, &b_fProtonDetFlightPath_fY);
//    fChain->SetBranchAddress("fZ", &fZ, &b_fProtonDetFlightPath_fZ);
   fChain->SetBranchAddress("fProtonDetChi2", &fProtonDetChi2, &b_fProtonDetChi2);
   fChain->SetBranchAddress("fProtonDetNDOF", &fProtonDetNDOF, &b_fProtonDetNDOF);
   fChain->SetBranchAddress("fProtonDetNdets", fProtonDetNdets, &b_fProtonDetNdets);
   fChain->SetBranchAddress("fProtonDetNhits", fProtonDetNhits, &b_fProtonDetNhits);
   fChain->SetBranchAddress("fProtonDetCharge", fProtonDetCharge, &b_fProtonDetCharge);
   fChain->SetBranchAddress("fProtonDetID", &fProtonDetID, &b_fProtonDetID);
   fChain->SetBranchAddress("fProtonDetPDG", &fProtonDetPDG, &b_fProtonDetPDG);
   fChain->SetBranchAddress("fProtonDetType", &fProtonDetType, &b_fProtonDetType);
//    fChain->SetBranchAddress("fX", &fX, &b_fDeltaDetPt_fX);
//    fChain->SetBranchAddress("fY", &fY, &b_fDeltaDetPt_fY);
//    fChain->SetBranchAddress("fZ", &fZ, &b_fDeltaDetPt_fZ);
*/ fChain->SetBranchAddress("fNeutrinoSim.fP.fX", &fNeutrinoSimfPfX);//, &b_fNeutrinoSim_fP);
   fChain->SetBranchAddress("fNeutrinoSim.fP.fY", &fNeutrinoSimfPfY);//, &b_fNeutrinoSim_fP);
   fChain->SetBranchAddress("fNeutrinoSim.fP.fZ", &fNeutrinoSimfPfZ);//, &b_fNeutrinoSim_fP);
   fChain->SetBranchAddress("fNeutrinoSim.fE", &fNeutrinoSimfE, &b_fNeutrinoSim_fE);
   fChain->SetBranchAddress("fNeutrinoRec", &fNeutrinoRec, &b_fNeutrinoRec);
   fChain->SetBranchAddress("fNeutrinoRec.fX", &fNeutrinoRecfX, &b_fNeutrinoRec_fX);
   fChain->SetBranchAddress("fNeutrinoRec.fY", &fNeutrinoRecfY, &b_fNeutrinoRec_fY);
   fChain->SetBranchAddress("fNeutrinoRec.fZ", &fNeutrinoRecfZ, &b_fNeutrinoRec_fZ);
   fChain->SetBranchAddress("fNeutrinoGuess.fX", &fNeutrinoGuessfX, &b_fNeutrinoGuess_fX);
   fChain->SetBranchAddress("fNeutrinoGuess.fY", &fNeutrinoGuessfY, &b_fNeutrinoGuess_fY);
   fChain->SetBranchAddress("fNeutrinoGuess.fZ", &fNeutrinoGuessfZ, &b_fNeutrinoGuess_fZ);
   fChain->SetBranchAddress("fdNeutrinoGuessNeutrinoSim", &fdNeutrinoGuessNeutrinoSim, &b_fdNeutrinoGuessNeutrinoSim);
   fChain->SetBranchAddress("fdNeutrinoGuessMuonRec", &fdNeutrinoGuessMuonRec, &b_fdNeutrinoGuessMuonRec);
   fChain->SetBranchAddress("fGuessCorrection", &fGuessCorrection, &b_fGuessCorrection);
   fChain->SetBranchAddress("fMuonPtGuess", &fMuonPtGuess, &b_fMuonPtGuess);
   fChain->SetBranchAddress("fOsciMuMuProb", &fOsciMuMuProb, &b_fOsciMuMuProb);
   fChain->SetBranchAddress("fkOsciMuSurvive", &fkOsciMuSurvive, &b_fkOsciMuSurvive);
   fChain->SetBranchAddress("fNeutrinoParentPDG", &fNeutrinoParentPDG, &b_fNeutrinoParentPDG);
   fChain->SetBranchAddress("fNeutrinoParentType", &fNeutrinoParentType, &b_fNeutrinoParentType);
   fChain->SetBranchAddress("fNeutrinoType", &fNeutrinoType, &b_fNeutrinoType);
   fChain->SetBranchAddress("fNeutMode", &fNeutMode, &b_fNeutMode);
   fChain->SetBranchAddress("fNeutrinoParentDecPointSim.fX", &fNeutrinoParentDecPointSimfX, &b_fNeutrinoParentDecPointSim_fX);
   fChain->SetBranchAddress("fNeutrinoParentDecPointSim.fY", &fNeutrinoParentDecPointSimfY, &b_fNeutrinoParentDecPointSim_fY);
   fChain->SetBranchAddress("fNeutrinoParentDecPointSim.fZ", &fNeutrinoParentDecPointSimfZ, &b_fNeutrinoParentDecPointSim_fZ);
   fChain->SetBranchAddress("fMultiplicity", &fMultiplicity, &b_fMultiplicity);
   fChain->SetBranchAddress("fMuonNSim", &fMuonNSim, &b_fMuonNSim);
   fChain->SetBranchAddress("fMuonNRec", &fMuonNRec, &b_fMuonNRec);
   fChain->SetBranchAddress("fProtonNSim", &fProtonNSim, &b_fProtonNSim);
   fChain->SetBranchAddress("fProtonNRec", &fProtonNRec, &b_fProtonNRec);
   fChain->SetBranchAddress("fMeanBetaRec", &fMeanBetaRec, &b_fMeanBetaRec);
   fChain->SetBranchAddress("fMeanGammaRec", &fMeanGammaRec, &b_fMeanGammaRec);
   Notify();
}

Bool_t MECPlotting::Notify()
{
   // The Notify() function is called when a new file is opened. This
   // can be either for a new TTree in a TChain or when when a new TTree
   // is started when using PROOF. It is normally not necessary to make changes
   // to the generated code, but the routine can be extended by the
   // user if needed. The return value is currently not used.

   return kTRUE;
}

void MECPlotting::Show(Long64_t entry)
{
// Print contents of entry.
// If entry is not specified, print current entry
   if (!fChain) return;
   fChain->Show(entry);
}
Int_t MECPlotting::Cut(Long64_t entry)
{
// This function may be called from Loop.
// returns  1 if entry is accepted.
// returns -1 otherwise.
   return 1;
}
#endif // #ifdef MECPlotting_cxx
